
<template>
  <h3>双向绑定指令</h3>
  <h3>用户注册</h3>
  用户名：<input type="text" placeholder="请输入用户名" v-model="user.username"><br>
  密码：<input type="password" placeholder="请输入密码" v-model="user.password"><br>
  性别：
  <input type="radio" value="1" v-model="user.gender">男
  <input type="radio" value="0" v-model="user.gender">女
  <br>
  <button @click="reg">点我注册</button>
</template>

<script setup>
  import {ref} from "vue";

  const user = ref({
    username:'baby',
    password:'666',
    gender:1
  })
  const reg = ()=>{
    console.log('注册成功....');
    console.log(user.value);
  }
</script>
<style scoped>

</style>